<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="vue.js"></script>
    <script src="axios-0.18.0.js"></script>
</head>
<body>

    <div id="app">
        <button @click="test()">点我测试跨域</button>
    </div>
</body>

<script>
    new Vue({
        el: '#app',
        methods : {
            test(){
                //axios.get("http://localhost:8082/carts/crossTest")
                axios.get("http://localhost:8080/carts/crossTest")
                    .then(res => {
                        console.log(res.data);
                    })
            }
        }
    });
</script>

<!-- localhost:8888/index.html  --- Ajax -- http://localhost:8082/carts/crossTest   -->

</html>